package com.unknowpupil.eth.service;

import com.unknowpupil.eth.dto.WalletDto;

import java.math.BigDecimal;

/**
 * @Classname: IWalletService
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2020/1/3 16:28
 * @Description:
 * @Version: 1.0
 */
public interface IWalletService {

    /**
     * 获取余额
     * @param address
     * @return
     * @throws Exception
     */
    BigDecimal getBalance(String address);

    /**
     * 创建钱包
     * @param password
     * @return
     * @throws Exception
     */
    WalletDto createWallet(String password);

    /**
     * 更具资源读取私钥公钥
     * @param source
     * @return
     */
    WalletDto readWalletBySource(String password ,String source) throws Exception;

    /**
     * 获取区块高度
     * @return
     * @throws Exception
     */
    int getBlockHeight();

    /**
     * 根据区块高度处理区块信息
     * @param height
     * @return
     * @throws Exception
     */
    boolean parseBlock(long height) throws Exception;

    /**
     * 处理交易信息
     * @param object
     * @throws Exception
     */
    void parserTransactionInfo(Object object) throws Exception;
}
